﻿Public Class Restaurant
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        'Dim oleDbConn As New OleDb.OleDbConnection(ConfigurationManager.ConnectionStrings("Outletsdb").ConnectionString)
        Dim dataSet As New DataSet()
        Dim sqlCmQuery As String
        sqlCmQuery = "select * from Restaurant"
        If Request.QueryString("Type").ToString.Trim() = "" Then
            sqlCmQuery = "select * from Restaurant"
        Else
            If Request.QueryString("Type").ToString.Trim() = "Breakfast" Then
                RestaurantType.Text = "Breakfast Options"

            End If
            If Request.QueryString("Type").ToString.Trim() = "Lunch" Then
                RestaurantType.Text = "Lunch Options"

            End If
            If Request.QueryString("Type").ToString.Trim() = "Dinner" Then
                RestaurantType.Text = "Dinner Options"

            End If
            sqlCmQuery = "select * from Restaurant where MealType='" & Request.QueryString("Type").ToString.Trim() & "'"
        End If

        Dim oleDataAdapter As New OleDb.OleDbDataAdapter(sqlCmQuery, ConfigurationManager.ConnectionStrings("Outletsdb").ConnectionString)
        oleDataAdapter.Fill(dataSet, "Restaurant")
        dataList.DataSource = dataSet.Tables("Restaurant").DefaultView
        dataList.DataBind()



        '   oleDbConn.Open()
    End Sub

End Class